package com.JavaBean.Ord_Rol_Use;

import java.util.ArrayList;

public class Role {
    private int role_id;
    private String roleName;
    private String roleDesc;
    private ArrayList<User> user;

    public Role() {
    }

    public Role(int role_id, String roleName, String roleDesc, ArrayList<User> user) {
        this.role_id = role_id;
        this.roleName = roleName;
        this.roleDesc = roleDesc;
        this.user = user;
    }

    /**
     * 获取
     * @return role_id
     */
    public int getRole_id() {
        return role_id;
    }

    /**
     * 设置
     * @param role_id
     */
    public void setRole_id(int role_id) {
        this.role_id = role_id;
    }

    /**
     * 获取
     * @return roleName
     */
    public String getRoleName() {
        return roleName;
    }

    /**
     * 设置
     * @param roleName
     */
    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    /**
     * 获取
     * @return roleDesc
     */
    public String getRoleDesc() {
        return roleDesc;
    }

    /**
     * 设置
     * @param roleDesc
     */
    public void setRoleDesc(String roleDesc) {
        this.roleDesc = roleDesc;
    }

    /**
     * 获取
     * @return user
     */
    public ArrayList<User> getUser() {
        return user;
    }

    /**
     * 设置
     * @param user
     */
    public void setUser(ArrayList<User> user) {
        this.user = user;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder("Role{role_id=").append(role_id)
                .append(", roleName='").append(roleName).append('\'')
                .append(", roleDesc='").append(roleDesc).append('\'')
                .append(", user=[");

        boolean first = true;
        for (User u : user) {
            if (!first) {
                sb.append(", ");
            }
            sb.append(u.toString());
            first = false;
        }

        sb.append(']');
        return sb.toString();
    }
}

